//
//  ViewController.m
//  DCWebImage
//
//  Created by Joinwe on 16/6/1.
//  Copyright © 2016年 Joinwe. All rights reserved.
//

#import "ViewController.h"
#import "UIImageView+DCWebCache.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 60, 320, 400)];
    [self.view addSubview:imageView];
    
    [imageView setImageWithURLString:@"http://h.hiphotos.baidu.com/image/pic/item/8601a18b87d6277f017b73322b381f30e924fc4b.jpg"];
    
    
    UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(20, 480, 280, 50)];
    button.backgroundColor = [UIColor greenColor];
    [button setTitle:@"清除缓存" forState:UIControlStateNormal];
    button.layer.cornerRadius = 4;
    [button addTarget:self action:@selector(clearDisk) forControlEvents:UIControlEventTouchUpInside];
//    [self.view addSubview:button];
    
}

- (void)clearDisk{
    [[DCImageCache sharedImageCache] clearDisk];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
